<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<style type="text/css">
	
	
	.main{

		padding-top: 100px;
	}
	.form-inline textarea.content{ 
		height: 100px;
		width: 80%;
	}


	</style>
	<link rel="stylesheet" href="./tpl/css/bootstrap.min.css" >
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">留言板</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <form class="navbar-form navbar-right" action="./logi.php" method="post">
            <div class="form-group">
              <input placeholder="用户名" name ="username" class="form-control" type="text">
            </div>
            <div class="form-group">
              <input placeholder="密码"name ="password" class="form-control" type="密码">
            </div>
            <button type="submit" class="btn btn-success">登录</button>
          </form>
        </div><!--/.navbar-collapse -->
      </div>
    </nav>
    
    <div class="col-md-12" style="margin-top:100px;">

   		<?php foreach ($db as $k => $v){?>

    		<div class="alert alert-danger" role="alert">
        		<strong>
        			<?php echo $v['username']?>
        		</strong>
					<?php echo $v['content']?> (<?php echo 
					date('Y-m-d  H:i:s',$v['create_time']) ?>)
					<a class="alert alert-danger" href="./del.php?id=<?php echo $k ?>">删除</a>
					<a class="alert alert-info" href="./edit.php?id=<?php echo $k ?>">修改</a>

      		</div>

      	<?php } ?>

      		<!-- <div class="alert alert-success" role="alert">
        		<strong>亲爱的梅</strong> 你家业想你了，啦啦啦啦
      		</div>
      		<div class="alert alert-success" role="alert">
        		<strong>么么哒</strong> 我会一直在你的背后默默的支持你了，爱你哟
     		 </div> -->
	</div>


	<div class="col-md-12" style="margin-top:20px;">
      	<form class="form-inline" method="post" action="add.php">
      		 <div class="col-md-12">
	  			<div class="form-group">
	    			<label for="exampleInputName2">用户名</label>
	    			<input type="text" class="form-control" id="exampleInputName2" name="username" placeholder="Jane Doe">
	 		 	</div>
	  			
  				<button type="submit" class="btn btn-success">留言</button>
  			</div>
			 <div class="col-md-12" style="margin-top:40px;width:100%;" >
  				<textarea class="form-control content" name="content" rows="3"></textarea>
  			</div>
		</form>
</div>

    
	
</body>
</html>